From 196783093e8772c9bd723d90eb9bad0ed24e08e1 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 12 Apr 2008 03:23:02 +0000 Subject: [PATCH] Add $wgRCTypeGroupedLogs to group certain logs by type in changes lists --- includes/ChangesList.php | 20 ++++++++------------ includes/DefaultSettings.php | 2 ++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index a49f1fc68c..1a923c72cc 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -439,7 +439,10 @@ class EnhancedChangesList extends ChangesList { // New unpatrolled pages } else if( $rc->unpatrolled && $rc_type == RC_NEW ) { $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" ); - // Other edits or log entries + // Log entries + } else if( $rc_type == RC_LOG ) { + $clink = $this->skin->makeLinkObj( $rc->getTitle(), '' ); + // Edits } else { $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '' ); } @@ -509,7 +512,9 @@ class EnhancedChangesList extends ChangesList { # Use an @ character to prevent collision with page names $this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc); } else { - if( $rc_type == RC_LOG ){ + global $wgRCTypeGroupedLogs; + # Some logs are best grouped by type (block,rights) + if( $rc_type == RC_LOG && in_array($rc_log_type,$wgRCTypeGroupedLogs) ){ $secureName = SpecialPage::getTitleFor( 'Log', $rc_log_type )->getPrefixedDBkey(); } if( !isset( $this->rc_cache[$secureName] ) ) { @@ -600,16 +605,7 @@ class EnhancedChangesList extends ChangesList { $r .= ' '.$block[0]->timestamp.' '; # Article link - if( $alllogs ){ - $logtype = $block[0]->mAttribs['rc_log_type']; - if( is_null( $logtype ) ){ - //Old format - $r .= $block[0]->link; - } else { - $logname = LogPage::logName( $logtype ); - $r .= ' (' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log', $logtype ), $logname ) . ')'; - } - } else if( $namehidden ) { + if( $namehidden ) { $r .= ' ' . wfMsgHtml('rev-deleted-event') . ''; } else { $r .= $this->maybeWatchedLink( $block[0]->link, $block[0]->watched ); diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 9e941351f1..aa16f51566 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1417,6 +1417,8 @@ $wgRCShowWatchingUsers = false; # UPO $wgPageShowWatchingUsers = false; /** Show the amount of changed characters in recent changes */ $wgRCShowChangedSize = true; +/** Logs that are grouped by log type, not page */ +$wgRCTypeGroupedLogs = array( 'block', 'rights' ); /** * If the difference between the character counts of the text -- 2.20.1